package scuts.core;

import haxe.macro.Expr.ExprRequire;
#if macro
import haxe.macro.Expr;
import scuts.macro.builder.PartialApplication;


#end

@:macro class PartApply1 {
    public static function partApply <A,B>(f:ExprRequire<A->B>, ?a:Expr):Expr {
    return PartialApplication.apply([f, a]);
  }
}
class PartApply2 {
    @:macro public static function partApply <A,B,C>(f:ExprRequire<A->B->C>, ?a:ExprRequire<A>, ?b:ExprRequire<B>):Expr {
    return PartialApplication.apply([f, a, b]);
  }
}

@:macro class PartApply3 {
   public static function partApply <A,B,C,D>(f:ExprRequire<A->B->C->D>, ?a:ExprRequire<A>, ?b:ExprRequire<B>, ?c:ExprRequire<C>):Expr {
    return PartialApplication.apply([f, a, b, c]);
  }
}
@:macro class PartApply4 {
   public static function partApply <A,B,C,D,E>(f:ExprRequire<A->B->C->D->E>, ?a:ExprRequire<A>, 
      ?b:ExprRequire<B>, ?c:ExprRequire<C>, ?d:ExprRequire<D>):Expr {
    return PartialApplication.apply([f, a, b, c, d]);
  }
}
@:macro class PartApply5 {
   public static function partApply <A,B,C,D,E,F>(f:ExprRequire<A->B->C->D->E->F>, ?a:ExprRequire<A>, 
      ?b:ExprRequire<B>, ?c:ExprRequire<C>, ?d:ExprRequire<D>, ?e:ExprRequire<E>):Expr {
    return PartialApplication.apply([f, a, b, c, d, e]);
  }
}
@:macro class PartApply6 {
   public static function partApply <A,B,C,D,E,F,G>(f:ExprRequire<A->B->C->D->E->F>, ?a:ExprRequire<A>, 
      ?b:ExprRequire<B>, ?c:ExprRequire<C>, ?d:ExprRequire<D>, ?e:ExprRequire<E>, ?f:ExprRequire<F>):Expr {
    return PartialApplication.apply([f, a, b, c, d, e, f]);
  }
}